﻿@model IEnumerable<Securfid_WEB.Models.rfid>

@{
    ViewBag.Title = "RFID";
}

<h2>RFID</h2>

<p>
    @Html.ActionLink("Create New", "Create")
</p>
<table>
    <tr>
        <th>
            Description
        </th>
        <th>
            # Cégep
        </th>
        <th>
            # RFID
        </th>
        <th>
            Local
        </th>
        <th>
            poste
        </th>
        <th>
            Dernère Vu
        </th>
        <th>
            Alarme
        </th>
        <th>
            Heure Alarme
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @foreach (var listapp in ViewBag.listAppareils)
            {
                if (item.id_appareil == listapp.id_appareil)
                {
                    @listapp.description
                }
            }
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.id_cegep)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.id_rfid)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.emplacement)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.poste)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.time)
        </td>
            @if (item.alarme == true) {
                <td><b>ON</b></td>
            } else {
                <td>OFF</td>
            }
        <td>
            @Html.DisplayFor(modelItem => item.heure_alarme)
        </td>
        <td>
            @Html.ActionLink("Edit", "Edit", new { id=item.id_cegep }) |
            @Html.ActionLink("Delete", "Delete", new { id = item.id_cegep })
        </td>
    </tr>
}

</table>
